package com.cqq.auth.service;

import java.util.List;

import com.cqq.auth.service.bean.PermissionBean;
import com.cqq.auth.service.exception.PermissionServiceException;

/**
 * <h3>权限服务接口</h3>
 * 
 * @author xijq
 * @version 1.0.0
 * 
 */
public interface PermissionService {

	/**
	 * <h3>添加权限</h3>
	 * 
	 * @param perm PermissionBean
	 * 
	 * @throws PermissionServiceException
	 */
	public void addPermission(PermissionBean perm) throws PermissionServiceException;

	/**
	 * <h3>更新权限</h3>
	 * 
	 * @param perm PermissionBean
	 * 
	 * @throws PermissionServiceException
	 */
	public void updatePermission(PermissionBean perm) throws PermissionServiceException;

	/**
	 * <h3>删除权限</h3>
	 * 
	 * @param id 权限ID
	 * 
	 * @throws PermissionServiceException
	 */
	public void deletePermission(Integer id) throws PermissionServiceException;

	
	/**
	 * <h3>指定系统查询所有权限列表</h3>
	 * 
	 * @param systemCode 系统代码
	 * 
	 * @return PermissionBean List
	 * 
	 */
	public List<PermissionBean> listAllPermission(String systemCode);
	
	/**
	 * <h3>查询角色拥有的所有权限列表</h3>
	 * 
	 * @param id 角色ID
	 * 
	 * @return PermissionBean List
	 * 
	 */
	public List<PermissionBean> listPermissionByRoleId(Integer id);
	
	/**
	 * <h3>查询用户拥有的所有权限列表</h3>
	 * 
	 * @param username 用户名
	 * @param systemCode 系统代码
	 * 
	 * @return PermissionBean List
	 * 
	 */
	public List<PermissionBean> listPermissionByUsername(String username,String systemCode);
	
	/**
	 * <h3>按权限父ID查询权限列表</h3>
	 * 
	 * @param parentId 权限父ID
	 * @param systemCode 系统代码
	 * 
	 * @return PermissionBean List
	 * 
	 */
	public List<PermissionBean> listPermissionByParentId(Integer parentId,String systemCode);
}
